<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Initializes all syslog related variables</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.define-syslog-variables" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">define_syslog_variables</h1>
  <p class="verinfo">(PHP 4, PHP 5 &lt; 5.4.0)</p><p class="refpurpose"><span class="refname">define_syslog_variables</span> &mdash; <span class="dc-title">Initializes all syslog related variables</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.define-syslog-variables-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>define_syslog_variables</strong></span>
    ( <span class="methodparam">void</span>
   ) : <span class="type"><span class="type void">void</span></span></div>

  <p class="para rdfs-comment">
   Initializes all variables used in the syslog functions.
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.define-syslog-variables-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。
  </p>
  <table class="doctable table">
   <caption><strong>Syslog variables</strong></caption>
   
    <thead>
     <tr>
      <th>Variable</th>
      <th>Constant equal</th>
      <th>Meaning</th>
      <th>Notes</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td><var class="varname"><var class="varname">$LOG_EMERG</var></var></td>
      <td><strong><code>LOG_EMERG</code></strong></td>
      <td>System is unusable</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_ALERT</var></var></td>
      <td><strong><code>LOG_ALERT</code></strong></td>
      <td>Immediate action required</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_CRIT</var></var></td>
      <td><strong><code>LOG_CRIT</code></strong></td>
      <td>Critical conditions</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_ERR</var></var></td>
      <td><strong><code>LOG_ERR</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_WARNING</var></var></td>
      <td><strong><code>LOG_WARNING</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_NOTICE</var></var></td>
      <td><strong><code>LOG_NOTICE</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_INFO</var></var></td>
      <td><strong><code>LOG_INFO</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_DEBUG</var></var></td>
      <td><strong><code>LOG_DEBUG</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_KERN</var></var></td>
      <td><strong><code>LOG_KERN</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_USER</var></var></td>
      <td><strong><code>LOG_USER</code></strong></td>
      <td>Genetic user level</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_MAIL</var></var></td>
      <td><strong><code>LOG_MAIL</code></strong></td>
      <td>Log to email</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_DAEMON</var></var></td>
      <td><strong><code>LOG_DAEMON</code></strong></td>
      <td>Other system daemons</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_AUTH</var></var></td>
      <td><strong><code>LOG_AUTH</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_SYSLOG</var></var></td>
      <td><strong><code>LOG_SYSLOG</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td>Not available on Netware</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_LPR</var></var></td>
      <td><strong><code>LOG_LPR</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_NEWS</var></var></td>
      <td><strong><code>LOG_NEWS</code></strong></td>
      <td>Usenet new</td>
      <td>Not available on HP-UX</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_CRON</var></var></td>
      <td><strong><code>LOG_CRON</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td>Not available on all platforms</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_AUTHPRIV</var></var></td>
      <td><strong><code>LOG_AUTHPRIV</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td>Not available on AIX</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_LOCAL0</var></var></td>
      <td><strong><code>LOG_LOCAL0</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td>Not available on Windows and Netware</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_LOCAL1</var></var></td>
      <td><strong><code>LOG_LOCAL1</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td>Not available on Windows and Netware</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_LOCAL2</var></var></td>
      <td><strong><code>LOG_LOCAL2</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td>Not available on Windows and Netware</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_LOCAL3</var></var></td>
      <td><strong><code>LOG_LOCAL3</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td>Not available on Windows and Netware</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_LOCAL4</var></var></td>
      <td><strong><code>LOG_LOCAL4</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td>Not available on Windows and Netware</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_LOCAL5</var></var></td>
      <td><strong><code>LOG_LOCAL5</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td>Not available on Windows and Netware</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_LOCAL6</var></var></td>
      <td><strong><code>LOG_LOCAL6</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td>Not available on Windows and Netware</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_LOCAL7</var></var></td>
      <td><strong><code>LOG_LOCAL7</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td>Not available on Windows and Netware</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_PID</var></var></td>
      <td><strong><code>LOG_PID</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_CONS</var></var></td>
      <td><strong><code>LOG_CONS</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_ODELAY</var></var></td>
      <td><strong><code>LOG_ODELAY</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_NDELAY</var></var></td>
      <td><strong><code>LOG_NDELAY</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td class="empty">&nbsp;</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_NOWAIT</var></var></td>
      <td><strong><code>LOG_NOWAIT</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td>Not available on BeOS</td>
     </tr>

     <tr>
      <td><var class="varname"><var class="varname">$LOG_PERROR</var></var></td>
      <td><strong><code>LOG_PERROR</code></strong></td>
      <td class="empty">&nbsp;</td>
      <td>Not available on AIX</td>
     </tr>

    </tbody>
   
  </table>

  <div class="warning"><strong class="warning">Warning</strong><p class="simpara">本函数已自 PHP 5.3.0 起<em class="emphasis">废弃</em>并将自
PHP 5.4.0 起<em class="emphasis">移除</em>。</p></div>
 </div>


 <div class="refsect1 examples" id="refsect1-function.define-syslog-variables-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-5479">
    <p><strong>Example #1 <span class="function"><strong>define_syslog_variables()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;Check&nbsp;if&nbsp;syslog&nbsp;variables&nbsp;already&nbsp;is&nbsp;defined<br /></span><span style="color: #007700">if(!</span><span style="color: #0000BB">get_cfg_var</span><span style="color: #007700">(</span><span style="color: #DD0000">'define_syslog_variables'</span><span style="color: #007700">))<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">define_syslog_variables</span><span style="color: #007700">();<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Open&nbsp;the&nbsp;log<br /></span><span style="color: #0000BB">openlog</span><span style="color: #007700">(</span><span style="color: #DD0000">''</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$LOG_ODELAY</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$LOG_MAIL&nbsp;</span><span style="color: #007700">|&nbsp;</span><span style="color: #0000BB">$LOG_USER</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Continue&nbsp;script&nbsp;...<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.define-syslog-variables-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>5.4.0</td>
       <td>
        This function was removed from PHP.
       </td>
      </tr>

      <tr>
       <td>5.3.0</td>
       <td>
        This function now throws an E_DEPRECATED notice.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.define-syslog-variables-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="openlog.html" class="function" rel="rdfs-seeAlso">openlog()</a> - Open connection to system logger</span></li>
    <li class="member"><span class="function"><a href="syslog.html" class="function" rel="rdfs-seeAlso">syslog()</a> - Generate a system log message</span></li>
    <li class="member"><span class="function"><a href="closelog.html" class="function" rel="rdfs-seeAlso">closelog()</a> - 关闭系统日志链接</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>